<?php
namespace App\Repositories\Backend;

use App\Models\Environment;
use Illuminate\Support\Facades\Auth;

class EnvironmentRepository extends CommonRepository
{
    public function __construct(Environment $environmentr)
    {
        parent::__construct($environmentr);
    }

    public function getLists($input)
    {
        $default_search = [
            'filter' => ['id' , 'environments_title', 'environments_image', 'order','created_at'],
            'sort'   => [
                'order' => 'asc',
            ]
        ];
        $search = $this->parseParams($default_search, $input);
        return $this->model->parseWheres($search)->paginate();
    }

    public function create( $environments_image,$environments_title, $order)
    {
        $result = $this->model->create([
            'environments_title' => $environments_title,
            'environments_image' => $environments_image,
            'order'              => $order,
        ]);

        return $result;
    }

    public function destroy( $id)
    {

        return $this->deleteById($id);
    }




}
